#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include<QPaintEvent> //用于绘画事件
#include<QtGui> //引入用到的控件
#include <QComboBox>
#include <QPushButton>
#include <QTextEdit>
#include <QSerialPort>
#include <QLabel>
#include <QWidget>
#include <QCheckBox>
#include <QLineEdit>
#include <shibotu.h>
extern bool flag;
extern bool flag_2;
extern bool flag_3;
class MainWindow : public QMainWindow
{
    Q_OBJECT
protected:
    ShiBoTu sbt;
    char convertHexFromChar(char);

private:
    QComboBox *cmbPortName,*cmbBaudRate,*cmbParity,*cmbDataBits,*cmbStopBits,*cmbFlowControl;
    QPushButton *btnOpen,*btnSend,*btnOpenTu;
    QTextEdit *teReceiveData,*teSendData;
    QLineEdit *letime;
    QLabel *lPortName,*lBaudRate,*lParity,*lDataBits,*lStopBits,*lReceiveData,*lSendData,
    *lFlowControl,*lCis;
    QSerialPort *my_serialport;
    QTimer *timer,*myTime;
    QWidget *widget;
    QCheckBox *cbSend,*cbDisplay,*cbTimingSend;

private slots:
    void on_btnOpen_clicked();
    void on_btnSend_clicked();
    void on_cbSend_clicked();
    void on_cbDisplay_clicked();
    void on_cmbPortName_change();
    void readComDataSlot();
//    void sendDataOnTime(bool);
    void on_btnOpenTu_clicked();
    void on_cbTimingSend_clicked(bool);
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
};

#endif // MAINWINDOW_H
